const joi = require('joi')
module.exports.login_schema = {
    body: {
        username: joi.string().alphanum().min(3).max(10).required(),
        password: joi.string().pattern(/^[\S]{6,18}$/).required()
    }
}

exports.manager_create_schema = {
    body: {
        username: joi.string().alphanum().min(3).max(10).required(),
        password: joi.string().pattern(/^[\S]{6,18}$/).required(),
        mobile: joi.string().pattern(/^1[3-9]\d{9}$/).required(),
        email: joi.string().email({ minDomainSegments: 2, tlds: { allow: ['com', 'net', 'cn'] } }).required()
    }
}

exports.manager_update_schema = {
    body: {
        // username: joi.string().alphanum().min(3).max(10).required(),
        // password: joi.string().pattern(/^[\S]{6,18}$/).required(),
        mobile: joi.string().pattern(/^1[3-9]\d{9}$/).required(),
        email: joi.string().email({ minDomainSegments: 2, tlds: { allow: ['com', 'net', 'cn'] } }).required()
    }
}